package com.tiemei.demo.unittest.mockito;

import static org.mockito.Mockito.*;
import java.util.List;

import org.junit.Test;

// 一句话总结mockito : mock一个类对另一个类的依赖，对 mock对象的行为进行验证
public class OneWordAboutMockito {
	@Test
	public void simplestMock() {
		// 1. mock
		List mockedList = mock(List.class);
		
		// 2. run
		mockedList.add("one");
		mockedList.clear();
		
		// 3. verification
		verify(mockedList).add("one");
		verify(mockedList).clear();
		
	}
}
